package com.duobao.uitl;

public class Zuanhuan {
    private Zuanhuan()
    {

    }
    public static void main(String args[])
    {
        System.out.println(ZhXiuwei.xwei(0, 0, 0));
    }
    public static String zhuang(int inumber)
    {
        String[] china = {"零","一","二","三","四","五","六","七","八","九"};
        //中文数字进位度量
        String[] degree = {"","十","百","千","万","十","百","千","亿"};


        String str="";
        if(inumber==0)
        {
            return "零";
        }
        int size=(int)Math.floor((int)(Math.log10(inumber)+1));
        int ls=inumber;
        for(int i=0;i<size;i++)
        {

            str=china[ls%10]+degree[i]+str;
            ls=ls/10;
        }
        while((str.indexOf("零千")!=-1)||(str.indexOf("零百")!=-1)||(str.indexOf("零十")!=-1)||(str.indexOf("零零")!=-1))
        {
          if(str.indexOf("零千")!=-1){
              str = str.replaceAll("零千","零");
          }
          if(str.indexOf("零百")!=-1){
              str = str.replaceAll("零百","零");
          }
          if(str.indexOf("零十")!=-1){
              str = str.replaceAll("零十","零");
          }
          if(str.indexOf("零零")!=-1){
              str = str.replaceAll("零零","零");
          }
       }
       if((str.indexOf("零万")!=-1))
       {
           str = str.replaceAll("零万","万");
       }
       if((str.indexOf("亿万")!=-1))
       {
           str = str.replaceAll("万","");
       }
       if(str.lastIndexOf("零")==str.length()-1)
       {
           str = str.substring(0,str.length()-1);
       }
       return str;
    }
}
